﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace Special_Item
{
    public partial class Pro_Admin_Manerge : Form
    {
        public Pro_Admin_Manerge()
        {
            InitializeComponent();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            ///建立数据库连接
            string str = @"Data Source=SC-201810171507\SQLEXPRESS；
				Initial Catalog=[Training_Project]
				Uid=SC-201810171507\Administator;
				Pwd=";
            var coon = new SqlConnection(str);
            
            try
            {
                coon.Open();
                
                var sql = string.Format("select Stu_project,Stu_stug,Stu_oncp FROM liebiao");
                SqlCommand sc = new SqlCommand(sql, coon);
                SqlDataAdapter sda = new SqlDataAdapter(sc);
                DataSet Training_Project = new DataSet();
                sda.Fill(Training_Project, "liebiao");
                dataGridView1.DataSource = Training_Project;
                dataGridView1.DataMember = "liebiao";
               
                
            }
            catch (Exception)
            {

            }
            finally
            {
                coon.Close();
            }

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void Pro_Admin_Manerge_Load(object sender, EventArgs e)
        {
            // TODO:  这行代码将数据加载到表“training_ProjectDataSet.liebiao”中。您可以根据需要移动或删除它。
            this.liebiaoTableAdapter.Fill(this.training_ProjectDataSet.liebiao);

        }
    }
}
